<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2010 Nitin Sewtahalsing <nitin@refresj.nl>
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
 * [CLASS/FUNCTION INDEX of SCRIPT]
 *
 * Hint: use extdeveval to insert/update function index above.
 */


$LANG->includeLLFile('EXT:ttnews_share/mod1/locallang.xml');
require_once(PATH_t3lib . 'class.t3lib_scbase.php');
$BE_USER->modAccess($MCONF,1);	// This checks permissions and exits if the users has no permission for entry.
	// DEFAULT initialization of a module [END]



/**
 * Module 'Social network share' for the 'ttnews_share' extension.
 *
 * @author	Nitin Sewtahalsing <nitin@refresj.nl>
 * @package	TYPO3
 * @subpackage	tx_ttnewsshare
 */
class  tx_ttnewsshare_module1 extends t3lib_SCbase {
	var $pageinfo;

	/**
	 * Initializes the Module
	 * @return	void
	 */
	function init()	{
		global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;

		parent::init();

		/*
		if (t3lib_div::_GP('clear_all_cache'))	{
			$this->include_once[] = PATH_t3lib.'class.t3lib_tcemain.php';
		}
		*/
	}

	/**
	 * Adds items to the ->MOD_MENU array. Used for the function menu selector.
	 *
	 * @return	void
	 */
	function menuConfig()	{
		global $LANG;
		$this->MOD_MENU = Array (
			'function' => Array (
				'1' => $LANG->getLL('function1'),
			)
		);
		parent::menuConfig();
	}

	/**
	 * Main function of the module. Write the content to $this->content
	 * If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree
	 *
	 * @return	[type]		...
	 */
	function main()	{
		global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;

		// Access check!
		// The page will show only if there is a valid page and if this page may be viewed by the user
		$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
		$access = is_array($this->pageinfo) ? 1 : 0;
	
			// initialize doc
		$this->doc = t3lib_div::makeInstance('template');
		$this->doc->setModuleTemplate(t3lib_extMgm::extPath('ttnews_share') . 'mod1/mod_template.html');
		$this->doc->backPath = $BACK_PATH;
		$this->docHeaderButtons = $this->getButtons();

		if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id))	{

				// Draw the form
			$this->doc->form = '<form action="" method="post" enctype="multipart/form-data">';
			
				// CSS
			$this->doc->styleSheetFile = '../typo3conf/ext/ttnews_share/mod1/styles/jquery.ui.css';
			$this->doc->styleSheetFile2 = '../typo3conf/ext/ttnews_share/mod1/styles/styles.css';

				// JavaScript
			$this->doc->JScode = '
			<script src="../typo3conf/ext/ttnews_share/mod1/javascript/jquery.js" type="text/javascript"></script>
			<script src="../typo3conf/ext/ttnews_share/mod1/javascript/jquery.ui.js" type="text/javascript"></script>
			<script src="../typo3conf/ext/ttnews_share/mod1/javascript/javascript.js" type="text/javascript"></script>
			
				<script language="javascript" type="text/javascript">
					script_ended = 0;
					function jumpToUrl(URL)	{
						document.location = URL;
					}
					
					function deleteSocialNetwork(){
						var confirmation = confirm("'.$LANG->getLL('delete_text').'");
						if(confirmation == true){
							window.location = "mod.php?M=web_txttnewsshareM1&deleteID='.$_POST['edit_uid'].'";
						} else {
							window.location="";
						}
					}
				</script>
			';
			$this->doc->postCode='
				<script language="javascript" type="text/javascript">
					script_ended = 1;
					if (top.fsMod) top.fsMod.recentIds["web"] = 0;
				</script>
			';
				// Render content:
			$this->moduleContent();
		} else {
				// If no access or if ID == zero
			$docHeaderButtons['save'] = '';
			$this->content.=$this->doc->spacer(10);
		}

			// compile document
		$markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
		$markers['CONTENT'] = $this->content;

				// Build the <body> for the module
		$this->content = $this->doc->startPage($LANG->getLL('title'));
		$this->content.= $this->doc->moduleBody($this->pageinfo, $this->docHeaderButtons, $markers);
		$this->content.= $this->doc->endPage();
		$this->content = $this->doc->insertStylesAndJS($this->content);
	
	}

	/**
	 * Prints out the module HTML
	 *
	 * @return	void
	 */
	function printContent()	{

		$this->content.=$this->doc->endPage();
		echo $this->content;
	}

	/**
	 * Generates the module content
	 *
	 * @return	void
	 */
	function moduleContent()	{
		global $LANG;
		switch((string)$this->MOD_SETTINGS['function'])	{
			case 1:
				if(isset($_POST['edit_network_x']) && !empty($_POST['edit_uid'])){
					$content = $this->editNetwork();
				} elseif(isset($_POST['add_network_x'])){
					$content = $this->addNetwork();
				} elseif(isset($_POST['save_new_x'])){
					if(empty($_POST['new_network']['title']) || empty($_POST['new_network']['url']) || empty($_POST['new_network']['imagepath'])){
						$o_flashMessage = t3lib_div::makeInstance(
							't3lib_FlashMessage',
							$LANG->getLL('add_warning_message1'),
							$LANG->getLL('add_warning_message_header'),
							t3lib_FlashMessage::WARNING
						);
						t3lib_FlashMessageQueue::addMessage($o_flashMessage);
						$content = $this->addNetwork();
					} else {
						$content = $this->save('new');
						$content = $this->displayNetworks();
					}
				} elseif(isset($_POST['save_edit_x'])){
					if(empty($_POST['new_network']['title']) || empty($_POST['new_network']['url']) || empty($_POST['new_network']['imagepath'])){
						$o_flashMessage = t3lib_div::makeInstance(
							't3lib_FlashMessage',
							$LANG->getLL('add_warning_message1'),
							$LANG->getLL('add_warning_message_header'),
							t3lib_FlashMessage::WARNING
						);
						t3lib_FlashMessageQueue::addMessage($o_flashMessage);
						$content = $this->editNetwork();
					} else {
						$content = $this->save('edit');
						$content = $this->displayNetworks();
					}
				} elseif(isset($_GET['deleteID'])){
					$content = $this->deleteNetwork($_GET['deleteID']);
					$content = $this->displayNetworks();
				} else {
					$content = $this->displayNetworks();
				}
				
				$this->content.=$this->doc->section('',$content,0,1);
			break;
		}
	}
	

	/**
	 * Create the panel of buttons for submitting the form or otherwise perform operations.
	 *
	 * @return	array	all available buttons as an assoc. array
	 */
	protected function getButtons()	{

		$buttons = array(
			'csh' => '',
			'shortcut' => '',
			'save_new' => '',
			'add' => ''
		);
			// CSH
		$buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH']);

			// SAVE new button
		$buttons['save_new'] = '<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-close"><input name="close_network" class="c-inputButton" src="clear.gif" title="Close network" type="image"></span><span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-save"><input name="save_new" class="c-inputButton" src="clear.gif" title="Save network" type="image"></span>';
		
			// SAVE edit button
		$buttons['save_edit'] = '<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-close"><input name="close_network" class="c-inputButton" src="clear.gif" title="Close network" type="image"></span><span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-save"><input name="save_edit" class="c-inputButton" src="clear.gif" title="Save network" type="image"></span> <a href="#" onclick="return deleteSocialNetwork();" title="Delete"><span class="t3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-delete"></span></a>';
				
			// ADD button
		$buttons['add'] = '<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new"><input type="image" class="c-inputButton" src="clear.gif" name="add_network" value="" title="Add network" /></span>';


			// Shortcut
		if ($GLOBALS['BE_USER']->mayMakeShortcut())	{
			$buttons['shortcut'] = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
		}

		return $buttons;
	}
	
	
	
	/**
	 * Insert or update social network
	 * 
	 * @return void
	 */
	function save($type){
		if($type == 'new'){
			$field_values = array(
				'hidden'	=> mysql_real_escape_string($_POST['new_network']['hidden']),
				'title'		=> mysql_real_escape_string($_POST['new_network']['title']),
				'url'		=> mysql_real_escape_string($_POST['new_network']['url']),
				'imagepath'	=> mysql_real_escape_string($_POST['new_network']['imagepath']),
				'shorturl'	=> mysql_real_escape_string($_POST['new_network']['shorturl']),
				'sorting'	=> 99
			);
			$res = $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_ttnewsshare_networks',$field_values);
		}
		
		if($type == 'edit'){
			$field_values = array(
				'hidden'	=> mysql_real_escape_string($_POST['new_network']['hidden']),
				'title'		=> mysql_real_escape_string($_POST['new_network']['title']),
				'url'		=> mysql_real_escape_string($_POST['new_network']['url']),
				'imagepath'	=> mysql_real_escape_string($_POST['new_network']['imagepath']),
				'shorturl'	=> mysql_real_escape_string($_POST['new_network']['shorturl']),
			);
			$res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_ttnewsshare_networks','uid="'.$_POST['edit_uid'].'"',$field_values);
		}
	}
	
	
	
	
	/**
	 * Delete a Social Network
	 * 
	 * @return	void
	 */
	function deleteNetwork($deleteUID){
		if(!empty($deleteUID)){
			$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_ttnewsshare_networks','uid="'.intval($deleteUID).'"');
		}
	}
	
	
	
	/**
	 * Displays all networks
	 * 
	 * @return	HTML
	 */
	function displayNetworks(){
		global $LANG;
		
		$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*','tx_ttnewsshare_networks','','','sorting ASC');
		
		$o_flashMessage = t3lib_div::makeInstance(
			't3lib_FlashMessage',
			$LANG->getLL('info_message1').'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new"><input type="image" class="c-inputButton" src="clear.gif" name="add_network" value="" title="Add network" /></span><br /><i>'.$LANG->getLL('info_message2').'</i>',
			$LANG->getLL('info_message_header'),
			t3lib_FlashMessage::INFO
		);
		t3lib_FlashMessageQueue::addMessage($o_flashMessage);
		
		$content = '
		<input type="hidden" id="edit_uid" name="edit_uid" value="0" />
		
		<div class="typo3-dyntabmenu-tabs">
			<table cellpadding="0" cellspacing="0" border="0" class="typo3-dyntabmenu">
				<tr>
					<td class="tabact" nowrap="nowrap"><a href="#" onclick="this.blur(); return false;">'.$LANG->getLL('tab1').'<img name="DTM-a825933d64-1-REQ" src="gfx/clear.gif" class="t3-TCEforms-reqTabImg" alt="" /></a></td>
				</tr>

			</table>
		</div>
		<div class="typo3-dyntabmenu-divs">

			<ul id="social_networks" class="typo3-TCEforms class-main11 wrapperTable1">';
		foreach($rows as $row){
			$checked = ' checked="checked"';
			$class_state = 'ui-state-default';
			if($row['hidden'] == 1){
				$checked = '';
				$class_state = 'ui-state-highlight';
			}
			$display_sort_number = $row['sorting'] + 1;
			$content .= '<li id="listItem_'.$row['uid'].'" class="network '.$class_state.'">
	<span class="ui-icon ui-icon-grip-dotted-vertical"></span>
	<span class="input_checkbox"><input type="checkbox" name="'.$row['uid'].'" value="'.$row['hidden'].'"'.$checked.' /></span>
	<img src="../'.$row['imagepath'].'" alt="'.$row['title'].'" />
	<span class="title">'.$row['title'].'</span>
	<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-open"><input name="edit_network" class="c-inputButton" src="clear.gif" onclick="changeEditUID('.$row['uid'].');" title="Edit network" type="image"></span>
</li>
			';
		}
		$content .= '</ul></div>';
		
		return $content;
	}		


	/**
	 * Displays edit network
	 * 
	 * @return	HTML
	 */
	function editNetwork(){
		global $LANG;
		$this->docHeaderButtons['add'] = $this->docHeaderButtons['save_edit'];
		
		$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*','tx_ttnewsshare_networks','uid="'.$_POST['edit_uid'].'"','','sorting ASC');
		
		$o_flashMessage = t3lib_div::makeInstance(
			't3lib_FlashMessage',
			'<i>'.$LANG->getLL('add_info_message1').'<img src="sysext/t3skin/icons/gfx/required_h.gif" alt=""> '.$LANG->getLL('add_info_message2').'</i>',
			$LANG->getLL('edit_info_message_header'),
			t3lib_FlashMessage::INFO
		);
		t3lib_FlashMessageQueue::addMessage($o_flashMessage);
		
		$hidden_checked = '';
		$shorturl_checked = '';
		if($rows[0]['hidden'] == 1){
			$hidden_checked = ' checked="checked"';
		}
		if($rows[0]['shorturl'] == 1){
			$shorturl_checked = ' checked="checked"';
		}
		
		$content = '
		<input type="hidden" id="edit_uid" name="edit_uid" value="'.$_POST['edit_uid'].'" />
		
		<div class="typo3-dyntabmenu-tabs">
			<table cellpadding="0" cellspacing="0" border="0" class="typo3-dyntabmenu">
				<tr>
					<td class="tabact" nowrap="nowrap"><a href="#" onclick="this.blur(); return false;">'.$LANG->getLL('tab2').'<img name="DTM-a825933d64-1-REQ" src="gfx/clear.gif" class="t3-TCEforms-reqTabImg" alt="" /></a></td>
				</tr>

			</table>
		</div>
		
		<div class="typo3-dyntabmenu-divs">
			<br />
			<div class="class-main12">
				<div class="left"><a class="typo3-csh-link" href="#"><span class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-help-open typo3-csh-icon"></span><div class="typo3-csh-inline"><p class="t3-csh-short">'.$LANG->getLL('help_hide').'</p></div></a></div>
				<div class="right"><span class="class-main14"><strong>'.$LANG->getLL('label_hide').'</strong></span></div>
			</div>
			<div class="class-main11">
				<div class="left"><img src="clear.gif" alt="" /><img src="clear.gif" alt="" /></div>
				<div class="right"><input type="checkbox" class="checkbox" value="1" name="new_network[hidden]"'.$hidden_checked.' /></div>
			</div>
			
			<div class="class-main12">
				<div class="left"><a class="typo3-csh-link" href="#"><span class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-help-open typo3-csh-icon"></span><div class="typo3-csh-inline"><p class="t3-csh-short">'.$LANG->getLL('help_title').'</p></div></a></div>
				<div class="right"><span class="class-main24"><strong>'.$LANG->getLL('label_title').'</strong></span></div>
			</div>
			<div class="class-main11">
				<div class="left"><img src="sysext/t3skin/icons/gfx/required_h.gif" alt=""><img src="clear.gif" alt=""></div>
				<div class="right"><input type="text" name="new_network[title]" value="'.$rows[0]['title'].'" style="width: 384px; " maxlength="256" /></div>
			</div>
			
			<div class="class-main12">
				<div class="left"><a class="typo3-csh-link" href="#"><span class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-help-open typo3-csh-icon"></span><div class="typo3-csh-inline"><p class="t3-csh-short">'.$LANG->getLL('help_url').'</p></div></a></div>
				<div class="right"><span class="class-main24"><strong>'.$LANG->getLL('label_url').'</strong></span></div>
			</div>
			<div class="class-main11">
				<div class="left"><img src="sysext/t3skin/icons/gfx/required_h.gif" alt=""><img src="clear.gif" alt=""></div>
				<div class="right"><textarea name="new_network[url]" style="width: 384px;" rows="3" wrap="OFF">'.$rows[0]['url'].'</textarea>
</div>
			</div>
			
			<div class="class-main12">
				<div class="left"><a class="typo3-csh-link" href="#"><span class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-help-open typo3-csh-icon"></span><div class="typo3-csh-inline"><p class="t3-csh-short">'.$LANG->getLL('help_imagepath').'</p></div></a></div>
				<div class="right"><span class="class-main24"><strong>'.$LANG->getLL('label_imagepath').'</strong></span></div>
			</div>
			<div class="class-main11">
				<div class="left"><img src="sysext/t3skin/icons/gfx/required_h.gif" alt=""><img src="clear.gif" alt=""></div>
				<div class="right"><textarea name="new_network[imagepath]" style="width: 384px;" rows="3" wrap="OFF">'.$rows[0]['imagepath'].'</textarea></div>
			</div>

			<div class="class-main12">
				<div class="left"><a class="typo3-csh-link" href="#"><span class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-help-open typo3-csh-icon"></span><div class="typo3-csh-inline"><p class="t3-csh-short">'.$LANG->getLL('help_shorturl').'</p></div></a></div>
				<div class="right"><span class="class-main14"><strong>'.$LANG->getLL('label_shorturl').'</strong></span></div>
			</div>
			<div class="class-main11">
				<div class="left"><img src="clear.gif" alt="" /><img src="clear.gif" alt="" /></div>
				<div class="right"><input type="checkbox" class="checkbox" value="1" name="new_network[shorturl]"'.$shorturl_checked.' /></div>
			</div>
		</div>';
		
		return $content;
	}
	
	
	
	/**
	 * Displays add network
	 * 
	 * @return	HTML
	 */
	function addNetwork(){
		global $LANG;
		
		$this->docHeaderButtons['add'] = $this->docHeaderButtons['save_new'];
		
		$o_flashMessage = t3lib_div::makeInstance(
			't3lib_FlashMessage',
			'<i>'.$LANG->getLL('add_info_message1').'<img src="sysext/t3skin/icons/gfx/required_h.gif" alt=""> '.$LANG->getLL('add_info_message2').'</i>',
			$LANG->getLL('add_info_message_header'),
			t3lib_FlashMessage::INFO
		);
		t3lib_FlashMessageQueue::addMessage($o_flashMessage);
		
		$content = '
		<div class="typo3-dyntabmenu-tabs">
			<table cellpadding="0" cellspacing="0" border="0" class="typo3-dyntabmenu">
				<tr>
					<td class="tabact" nowrap="nowrap"><a href="#" onclick="this.blur(); return false;">'.$LANG->getLL('tab3').'<img name="DTM-a825933d64-1-REQ" src="gfx/clear.gif" class="t3-TCEforms-reqTabImg" alt="" /></a></td>
				</tr>

			</table>
		</div>
		
		<div class="typo3-dyntabmenu-divs">
			<br />
				<div class="class-main12">
					<div class="left"><a class="typo3-csh-link" href="#" ><span class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-help-open typo3-csh-icon"></span><div class="typo3-csh-inline"><p class="t3-csh-short">'.$LANG->getLL('help_hide').'</p></div></a></div>
					<div class="right"><span class="class-main14"><strong>'.$LANG->getLL('label_hide').'</strong></span></div>
				</div>
				<div class="class-main11">
					<div class="left"><img src="clear.gif" alt="" /><img src="clear.gif" alt="" /></div>
					<div class="right"><input type="checkbox" class="checkbox" value="1" name="new_network[hidden]" /></div>
				</div>
				
				<div class="class-main12">
					<div class="left"><a class="typo3-csh-link" href="#"><span class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-help-open typo3-csh-icon"></span><div class="typo3-csh-inline"><p class="t3-csh-short">'.$LANG->getLL('help_title').'</p></div></a></div>
					<div class="right"><span class="class-main24"><strong>'.$LANG->getLL('label_title').'</strong></span></div>
				</div>
				<div class="class-main11">
					<div class="left"><img src="sysext/t3skin/icons/gfx/required_h.gif" alt=""><img src="clear.gif" alt=""></div>
					<div class="right"><input type="text" name="new_network[title]" value="'.$_POST['new_network']['title'].'" style="width: 384px; " maxlength="256" /></div>
				</div>
				
				<div class="class-main12">
					<div class="left"><a class="typo3-csh-link" href="#"><span class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-help-open typo3-csh-icon"></span><div class="typo3-csh-inline"><p class="t3-csh-short">'.$LANG->getLL('help_url').'</p></div></a></div>
					<div class="right"><span class="class-main24"><strong>'.$LANG->getLL('label_url').'</strong></span></div>
				</div>
				<div class="class-main11">
					<div class="left"><img src="sysext/t3skin/icons/gfx/required_h.gif" alt=""><img src="clear.gif" alt=""></div>
					<div class="right"><textarea name="new_network[url]" style="width: 384px;" rows="3" wrap="OFF">'.$_POST['new_network']['url'].'</textarea>
</div>
				</div>
				
				<div class="class-main12">
					<div class="left"><a class="typo3-csh-link" href="#"><span class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-help-open typo3-csh-icon"></span><div class="typo3-csh-inline"><p class="t3-csh-short">'.$LANG->getLL('help_imagepath').'</p></div></a></div>
					<div class="right"><span class="class-main24"><strong>'.$LANG->getLL('label_imagepath').'</strong></span></div>
				</div>
				<div class="class-main11">
					<div class="left"><img src="sysext/t3skin/icons/gfx/required_h.gif" alt=""><img src="clear.gif" alt=""></div>
					<div class="right"><textarea name="new_network[imagepath]" style="width: 384px;" rows="3" wrap="OFF">'.$_POST['new_network']['imagepath'].'</textarea></div>
				</div>

				<div class="class-main12">
					<div class="left"><a class="typo3-csh-link" href="#"><span class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-help-open typo3-csh-icon"></span><div class="typo3-csh-inline"><p class="t3-csh-short">'.$LANG->getLL('help_shorturl').'</p></div></a></div>
					<div class="right"><span class="class-main14"><strong>'.$LANG->getLL('label_shorturl').'</strong></span></div>
				</div>
				<div class="class-main11">
					<div class="left"><img src="clear.gif" alt="" /><img src="clear.gif" alt="" /></div>
					<div class="right"><input type="checkbox" class="checkbox" value="1" name="new_network[shorturl]" /></div>
				</div>
		</div>';
		
		return $content;
	}
	
}



if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/ttnews_share/mod1/index.php'])	{
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/ttnews_share/mod1/index.php']);
}




// Make instance:
$SOBE = t3lib_div::makeInstance('tx_ttnewsshare_module1');
$SOBE->init();

// Include files?
foreach($SOBE->include_once as $INC_FILE)	include_once($INC_FILE);

$SOBE->main();
$SOBE->printContent();

?>